<?php
define('ROOT_PATH', __DIR__);

try {
    $config = new \Phalcon\Config\Adapter\Php(ROOT_PATH . '/app/config/system.php');

    /**
     * 引入 loader.php
     */
    require ROOT_PATH . '/app/core/loader.php';

    require ROOT_PATH . '/app/core/services.php';

    /**
     * 处理请求信息
     */
    $application = new \Phalcon\Mvc\Application($di);

    $application->registerModules([
        'frontend'  =>  [
            'className'     =>      'Marser\App\Frontend\FrontendModule',
            'path'          =>      ROOT_PATH . '/app/frontend/FrontendModule.php',
        ],
        'backend'   =>  [
            'className'     =>      'Marser\App\Backend\BackendModule',
            'path'          =>      ROOT_PATH . '/app/backend/BackendModule.php',
        ],
    ]);

    echo $application->handle()->getContent();

} catch (Exception $exception) {
    var_dump($exception->getMessage());
}